package com.matrix.gallery.ui.wallpaper.apiService

import com.matrix.basecore.net.WallpaperResultData
import com.matrix.gallery.ui.wallpaper.bean.PhoneBean
import com.matrix.gallery.ui.wallpaper.bean.PhoneComputerTypeBean
import com.matrix.gallery.ui.wallpaper.bean.WallpaperBean
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
import retrofit2.http.Streaming
import retrofit2.http.Url

interface GalleryService {

    @GET("/v1/vertical/category")
    suspend fun phoneWallpaper(
        @Query("adult") adult: Boolean,
        @Query("first") first: Int
    ): WallpaperResultData<PhoneComputerTypeBean>

    @GET("/v1/wallpaper/category")
    suspend fun computerWallpaper(
        @Query("adult") adult: Boolean,
        @Query("first") first: Int
    ): WallpaperResultData<PhoneComputerTypeBean>

    @GET("/v1/vertical/category/{id}/vertical")
    suspend fun getPhoneWallpaper(
        @Path("id") id: String,
        @Query("limit") limit: Int,
        @Query("skip") skip: Int,
        @Query("adult") adult: Boolean,
        @Query("first") first: Int,
        @Query("order") order: String
    ): WallpaperResultData<PhoneBean>

    @GET("/v1/wallpaper/category/{id}/wallpaper")
    suspend fun getComputerWallpaper(
        @Path("id") id: String,
        @Query("limit") limit: Int,
        @Query("skip") skip: Int,
        @Query("adult") adult: Boolean,
        @Query("first") first: Int,
        @Query("order") order: String
    ): WallpaperResultData<WallpaperBean>

    @Streaming
    @GET
    suspend fun download(@Url url: String): Call<ResponseBody>

    @Streaming
    @GET
    fun downloads(@Url url: String): Call<ResponseBody>

}